<?php
class isp_print_formulir_model extends MY_Model {
	var $model = 'isp_print';
	
	function GetJSON()
	{
		$ls_sql	= "	SELECT	*
					FROM	ISP_CUSTOMER
					WHERE	(UPPER(kode_customer) LIKE '%".strtoupper(post('keyword'))."%'
							OR UPPER(nama) LIKE '%".strtoupper(post('keyword'))."%'
							OR UPPER(alamat) LIKE '%".strtoupper(post('keyword'))."%')
					ORDER BY ".(post('sort')=='' ? 'kode_customer' : post('sort'))." ".(post('order')=='' ? 'asc' : post('order'));
					
		return json_encode( $this->paging($ls_sql) );
	}
		

	function GetSingle($as_kode_customer){
		$result = $this->db->get_where('isp_print', array('kode_customer' => $as_kode_customer));
		if($result->num_rows() == 1){
			return $result->row_array();
		}else{
			return NULL;
		}
	}
	
	function GetSingleView($as_kode_customer)
	{
		$result = $this->db->get_where('isp_print', array('kode_customer' => $as_kode_customer));
		if($result->num_rows() == 1){
			return $result->row_array();
		}else{
			return NULL;
		}
	}


}
?>